import { RouteRecordRaw } from 'vue-router';

const router: RouteRecordRaw[] = [
  {
    path: '/scale',
    name: 'scale',
    redirect: { name: 'scaleLayout' },
    component: () => import('@/layouts/LayoutFirst.vue'),
    children: [
      {
        path: '/scale/',
        name: 'scaleLayout',
        redirect: { name: 'scaleList' },
        component: () => import('@/layouts/LayoutSecond.vue'),
        children: [
          {
            path: '/scale/list',
            name: 'scaleList',
            component: () => import('@/pages/scale/views/list.vue'),
            meta: {
              title: {
                isBack: false,
                list: [{ label: '量表管理' }],
              },
            },
          },
          {
            path: '/scale/info/:id',
            name: 'scaleInfo',
            component: () => import('@/pages/scale/views/info.vue'),
            meta: {
              title: {
                isBack: true,
                list: [{ label: '量表管理', url: '/scale/list' }, { label: '量表详情' }],
              },
            },
          },
          {
            path: '/scale/test/:id',
            name: 'scaleTest',
            component: () => import('@/pages/scale/views/test.vue'),
            meta: {
              title: {
                isBack: true,
                list: [{ label: '量表管理', url: '/scale/list' }, { label: '量表测试' }],
              },
            },
          },
        ],
      },
    ],
  },
];

export default router;
